home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Development / PowerD / Pdmod / modules / devices / sana2.m < prev    next >
Encoding:
Text File  |  2002-10-28  |  8.7 KB  |  195 lines

  1. /*
  2. **      $Filename: devices/sana2.h $
  3. **      $Revision: 1.1 $
  4. **      $Date: 1993/06/04 11:16:15 $
  5. **
  6. **      Structure definitions for SANA-II devices.
  7. **
  8. **      (C) Copyright 1991 Commodore-Amiga Inc.
  9. **              All Rights Reserved
  10. */
  11.  
  12. MODULE  'exec/ports'
  13. MODULE  'exec/io'
  14. MODULE  'exec/errors'
  15. MODULE  'devices/timer'
  16. MODULE  'utility/tagitem'
  17.  
  18. #define SANA2_MAX_ADDR_BITS      (128)
  19. #define SANA2_MAX_ADDR_BYTES     ((SANA2_MAX_ADDR_BITS+7)/8)
  20.  
  21. OBJECT IOSana2Req
  22.         Req:IORequest,
  23.         WireError:ULONG,                        /* wire type specific error     */
  24.         PacketType:ULONG,                       /* packet type                  */
  25.         SrcAddr[SANA2_MAX_ADDR_BYTES]:UBYTE,    /* source addr  */
  26.         DstAddr[SANA2_MAX_ADDR_BYTES]:UBYTE,    /* dest address */
  27.         DataLength:ULONG,                       /* length of packet data        */
  28.         Data:PTR TO VOID,                       /* packet data                  */
  29.         StatData:PTR TO VOID,                   /* statistics data pointer      */
  30.         BufferManagement:PTR TO VOID            /* see SANA-II OpenDevice adoc  */
  31.  
  32. /*
  33. ** defines for the io_Flags field
  34. */
  35.  
  36. #define SANA2IOB_RAW     (7)                    /* raw packet IO requested      */
  37. #define SANA2IOF_RAW     (1<<SANA2IOB_RAW)
  38. #define SANA2IOB_BCAST   (6)                    /* broadcast packet (received)  */
  39. #define SANA2IOF_BCAST   (1<<SANA2IOB_BCAST)
  40. #define SANA2IOB_MCAST   (5)                    /* multicast packet (received)  */
  41. #define SANA2IOF_MCAST   (1<<SANA2IOB_MCAST)
  42. #define SANA2IOB_QUICK   (IOB_QUICK)            /* quick IO requested (0)       */
  43. #define SANA2IOF_QUICK   (IOF_QUICK)
  44.  
  45. /*
  46. ** defines for OpenDevice() flags
  47. */
  48.  
  49. #define SANA2OPB_MINE    (0)                    /* exclusive access requested   */
  50. #define SANA2OPF_MINE    (1<<SANA2OPB_MINE)
  51. #define SANA2OPB_PROM    (1)                    /* promiscuous mode requested   */
  52. #define SANA2OPF_PROM    (1<<SANA2OPB_PROM)
  53.  
  54. /*
  55. ** defines for OpenDevice() tags
  56. */
  57.  
  58. #define S2_Dummy         (TAG_USER + $B0000)
  59. #define S2_CopyToBuff    (S2_Dummy + 1)
  60. #define S2_CopyFromBuff  (S2_Dummy + 2)
  61.  
  62. OBJECT Sana2DeviceQuery
  63.         SizeAvailable:ULONG,     /* bytes available              */
  64.         SizeSupplied:ULONG,      /* bytes supplied               */
  65.         DevQueryFormat:ULONG,    /* this is type 0               */
  66.         DeviceLevel:ULONG,       /* this document is level 0     */
  67.         AddrFieldSize:UWORD,     /* address size in bits         */
  68.         MTU:ULONG,               /* maximum packet data size     */
  69.         BPS:ULONG,               /* line rate (bits/sec)         */
  70.         HardwareType:ULONG       /* what the wire is             */
  71.  
  72. /*
  73. ** defined Hardware types
  74. **
  75. **  If your hardware type isn't listed below contact CATS to get a new
  76. **  type number added for your hardware.
  77. */
  78.  
  79. #define S2WireType_Ethernet              1
  80. #define S2WireType_IEEE802               6
  81. #define S2WireType_Arcnet                7
  82. #define S2WireType_LocalTalk             11
  83. #define S2WireType_DyLAN                 12
  84. #define S2WireType_AmokNet               200
  85. #define S2WireType_PPP                   253
  86. #define S2WireType_SLIP                  254
  87. #define S2WireType_CSLIP                 255
  88.  
  89. OBJECT Sana2PacketTypeStats
  90.         PacketsSent:ULONG,        /* transmitted count            */
  91.         PacketsReceived:ULONG,    /* received count               */
  92.         BytesSent:ULONG,          /* bytes transmitted count      */
  93.         BytesReceived:ULONG,      /* bytes received count         */
  94.         PacketsDropped:ULONG      /* packets dropped count        */
  95.  
  96. OBJECT Sana2SpecialStatRecord
  97.         Type:ULONG,             /* statistic identifier         */
  98.         Count:ULONG,            /* the statistic                */
  99.         String:PTR TO UBYTE     /* statistic name               */
  100.  
  101. OBJECT Sana2SpecialStatHeader
  102.         RecordCountMax:ULONG,         /* room available               */
  103.         RecordCountSupplied:ULONG     /* number supplied              */
  104.  
  105. OBJECT Sana2DeviceStats
  106.         PacketsReceived:ULONG,         /* received count               */
  107.         PacketsSent:ULONG,             /* transmitted count            */
  108.         BadData:ULONG,                 /* bad packets received         */
  109.         Overruns:ULONG,                /* hardware miss count          */
  110.         Unused:ULONG,                  /* Unused field                 */
  111.         UnknownTypesReceived:ULONG,    /* orphan count                 */
  112.         Reconfigurations:ULONG,        /* network reconfigurations     */
  113.         LastStart:TimeVal              /* time of last online          */
  114.  
  115. /*
  116. ** Device Commands
  117. */
  118. #define S2_START                 (CMD_NONSTD)
  119. #define S2_DEVICEQUERY           (S2_START+ 0)
  120. #define S2_GETSTATIONADDRESS     (S2_START+ 1)
  121. #define S2_CONFIGINTERFACE       (S2_START+ 2)
  122. #define S2_ADDMULTICASTADDRESS   (S2_START+ 5)
  123. #define S2_DELMULTICASTADDRESS   (S2_START+ 6)
  124. #define S2_MULTICAST             (S2_START+ 7)
  125. #define S2_BROADCAST             (S2_START+ 8)
  126. #define S2_TRACKTYPE             (S2_START+ 9)
  127. #define S2_UNTRACKTYPE           (S2_START+10)
  128. #define S2_GETTYPESTATS          (S2_START+11)
  129. #define S2_GETSPECIALSTATS       (S2_START+12)
  130. #define S2_GETGLOBALSTATS        (S2_START+13)
  131. #define S2_ONEVENT               (S2_START+14)
  132. #define S2_READORPHAN            (S2_START+15)
  133. #define S2_ONLINE                (S2_START+16)
  134. #define S2_OFFLINE               (S2_START+17)
  135. #define S2_END                   (S2_START+18)
  136.  
  137. /*
  138. ** defined errors for io_Error  (see also <exec/errors.h>)
  139. */
  140. #define S2ERR_NO_ERROR           0              /* peachy-keen                  */
  141. #define S2ERR_NO_RESOURCES       1              /* resource allocation failure  */
  142. #define S2ERR_BAD_ARGUMENT       3              /* garbage somewhere            */
  143. #define S2ERR_BAD_STATE          4              /* inappropriate state          */
  144. #define S2ERR_BAD_ADDRESS        5              /* who?                         */
  145. #define S2ERR_MTU_EXCEEDED       6              /* too much to chew             */
  146. #define S2ERR_NOT_SUPPORTED      8              /* hardware can't support cmd   */
  147. #define S2ERR_SOFTWARE           9              /* software error detected      */
  148. #define S2ERR_OUTOFSERVICE       10             /* driver is OFFLINE            */
  149.  
  150. /*
  151. ** From <exec/errors.h>
  152. **
  153. **      IOERR_OPENFAIL   (-1) * device/unit failed to open *
  154. **      IOERR_ABORTED    (-2) * request terminated early [after AbortIO()] *
  155. **      IOERR_NOCMD      (-3) * command not supported by device *
  156. **      IOERR_BADLENGTH  (-4) * not a valid length (usually IO_LENGTH) *
  157. **      IOERR_BADADDRESS (-5) * invalid address (misaligned or bad range) *
  158. **      IOERR_UNITBUSY   (-6) * device opens ok, but requested unit is busy *
  159. **      IOERR_SELFTEST   (-7) * hardware failed self-test *
  160. */
  161.  
  162. /*
  163. ** defined errors for ios2_WireError
  164. */
  165. #define S2WERR_GENERIC_ERROR     0              /* no specific info available   */
  166. #define S2WERR_NOT_CONFIGURED    1              /* unit not configured          */
  167. #define S2WERR_UNIT_ONLINE       2              /* unit is currently online     */
  168. #define S2WERR_UNIT_OFFLINE      3              /* unit is currently offline    */
  169. #define S2WERR_ALREADY_TRACKED   4              /* protocol already tracked     */
  170. #define S2WERR_NOT_TRACKED       5              /* protocol not tracked         */
  171. #define S2WERR_BUFF_ERROR        6              /* buff mgt func returned error */
  172. #define S2WERR_SRC_ADDRESS       7              /* source address problem       */
  173. #define S2WERR_DST_ADDRESS       8              /* destination address problem  */
  174. #define S2WERR_BAD_BROADCAST     9              /* broadcast address problem    */
  175. #define S2WERR_BAD_MULTICAST     10             /* multicast address problem    */
  176. #define S2WERR_MULTICAST_FULL    11             /* multicast address list full  */
  177. #define S2WERR_BAD_EVENT         12             /* unsupported event class      */
  178. #define S2WERR_BAD_STATDATA      13             /* statdata failed sanity check */
  179. #define S2WERR_IS_CONFIGURED     15             /* attempt to config twice      */
  180. #define S2WERR_NULL_POINTER      16             /* null pointer detected        */
  181.  
  182. /*
  183. ** defined events
  184. */
  185. #define S2EVENT_ERROR            (1<<0)         /* error catch all              */
  186. #define S2EVENT_TX               (1<<1)         /* transmitter error catch all  */
  187. #define S2EVENT_RX               (1<<2)         /* receiver error catch all     */
  188. #define S2EVENT_ONLINE           (1<<3)         /* unit is in service           */
  189. #define S2EVENT_OFFLINE          (1<<4)         /* unit is not in service       */
  190. #define S2EVENT_BUFF             (1<<5)         /* buff mgt function error      */
  191. #define S2EVENT_HARDWARE         (1<<6)         /* hardware error catch all     */
  192. #define S2EVENT_SOFTWARE         (1<<7)         /* software error catch all     */
  193.  
  194.  
  195.